USE Liberty
GO
-- ------------------------------------------------------------------------------------------------
-- People create table script
-- ------------------------------------------------------------------------------------------------
SET NOCOUNT OFF
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
GO

PRINT 'Creating Table People...'
GO

IF OBJECT_ID( 'People' ) IS NULL
BEGIN
	CREATE TABLE dbo.People
	(OID				bigint		IDENTITY(1, 1)	NOT NULL
	,Version			rowversion
	,FirstName			varchar(128)				NOT NULL
	,LastName			varchar(128)				NOT NULL
	,MiddleInitial		char(01)						NULL
	,DOB				smalldatetime				    NULL
	,Sex				char(01)						NULL
	,Phone1				varchar(20)						NULL
	,Phone2				varchar(20)						NULL
	,eMailAddress		varchar(128)					NULL
	,UpdatedDate		datetime					NOT NULL
		CONSTRAINT DFLT_People_UpdatedDate DEFAULT GETDATE()
	,CreatedDate		datetime					NOT NULL
		CONSTRAINT DFLT_People_CreatedDate DEFAULT GETDATE()

	,CONSTRAINT PK_People PRIMARY KEY CLUSTERED( OID ) --ON PRIMARY

	)
    PRINT 'Table People has been created successfully.'
END
ELSE 
BEGIN
	PRINT 'Table People already exists.'
END

GO
